<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreatePercentage extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(
            'percentage',
            function (Blueprint $table) {
                $table->integerIncrements('id');
                $table->unsignedInteger('cooperative_id')->default(0)->comment('合作商id');
                $table->unsignedInteger('employer_id')->default(0)->comment('悬赏主id');
                $table->unsignedInteger('task_id')->default(0)->comment('任务id');
                $table->unsignedDecimal('price', 10, 2)->default(0.00)->comment('抽成金额');
                $table->timestamps();
            }
        );
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('percentage');
    }
}
